package com.zx.feign.client;

import com.zx.core.wrapper.ObjectWrapper;
import com.zx.core.wrapper.ResponseWrapper;
import com.zx.feign.client.dto.GetNotificationTemplateResponseDTO;
import com.zx.feign.client.fallbackfactory.NotificationServiceClientFallbackFactory;
import com.zx.feign.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * description: 通知服务Feign客户端 <br>
 * create: 2025-10-15
 * </p>
 *
 * @author zhou  xun
 */
@FeignClient(value = "zx-notification-producer", fallbackFactory = NotificationServiceClientFallbackFactory.class, configuration = FeignConfig.class)
public interface NotificationServiceClient {

    /**
     * 发送系统通知
     *
     * @param paramJsonStr 系统通知参数JSON字符串
     * @return {@link ResponseWrapper}
     */
    @PostMapping("/system-notifications/addSystemNotification")
    ResponseWrapper sendNotification(@RequestBody String paramJsonStr);

    /**
     * 重新发送系统通知
     *
     * @param notificationId 通知ID
     * @return {@link ResponseWrapper}
     */
    @PostMapping("/system-notifications/resendNotification")
    ResponseWrapper resendNotification(@RequestParam("notificationId") String notificationId);

    /**
     * 根据模板编码获取通知模板
     *
     * @param templateCode 模板编码
     * @return 通知模板信息
     */
    @GetMapping("/notification-templates/getByCode/{templateCode}")
    ObjectWrapper<GetNotificationTemplateResponseDTO> getTemplateByCode(@PathVariable("templateCode") String templateCode);

}